package com.lmt_12;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;

public class InputTest {
    public static void main(String[] args) throws Exception {
        File file = new File("src/com/lmt_12/1.txt");
        int length = (int) file.length();
        InputStream fileInputStream = new FileInputStream("src/com/lmt_12/1.txt");

        //int read = fileInputStream.read();
//        int b ;
//        while ((b = fileInputStream.read())!= -1){  // if the file is reading over , return -1
//            System.out.print((char) b);
//        }
//        System.out.println("===========");
//        byte[] buffer = new byte[3];
//        int len = fileInputStream.read(buffer);  // return the bytes you read
//        System.out.println(new String(buffer)); // get result


        //int len ;
        //int read = fileInputStream.read(bytes);
        //System.out.println(new String(bytes));
//        while ((len = fileInputStream.read(bytes))!= -1){
//            String s = new String(bytes, 0, len); // sure the len you read
//            System.out.print(s);
//        }
        fileInputStream.close(); // after using ,you should close the stream
    }
}
